const mongoose = require('mongoose')
const Schema = mongoose.Schema
mongoose.connect('mongodb://localhost:27017/user')

var userSchema = new Schema({
  username: { type: String, required: true },
  password: { type: String, required: true },
  realname: { type: String, required: true },
  email: { type: String, required: true },
  avatar: {
    type: String,
    default: ''
  },
  sex: {
    type: String,
    enum: ['男', '女', '保密']
  },
  introduce: {
    type: String,
    default: ''
  }
})

module.exports = mongoose.model('User', userSchema)